package com.github.androiddevelopmentframework;

import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;

import com.github.freewu.commons.libs.pullDownRefreshView;
import com.github.freewu.mvp.presenter.Presenter;
import com.github.freewu.mvp.view.BaseActivity;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * Created by free on 16-8-13.
 */
public class RefreshActivity extends BaseActivity {
    private pullDownRefreshView refreshView;

    private Button btn;

    @Override
    public int getLayout() {
        return R.layout.activity_refresh;
    }

    @Override
    public void initView(View mView) {
        refreshView=(pullDownRefreshView)findViewById(R.id.refresh_view);
        btn=(Button)findViewById(R.id.button2);

        List<String> stringList=new ArrayList<>();

        for(int i=0;i<20;i++){
            stringList.add(i+"");
        }

        refreshView.setAdapter(new ArrayAdapter<String>(getContext(),android.R.layout.simple_list_item_1,stringList));

        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                refreshView.scrollBy(0,100);
            }
        });
    }

    @Override
    public void initData() {

    }
}
